#ifndef UIGRAPHICSSCENE_H
#define UIGRAPHICSSCENE_H

#include "qwidget.h"
#include <QGraphicsScene>
#include <QGraphicsSceneWheelEvent>
#include <QImage>
#include <QPainter>
#include <QRectF>

class UiGraphicsScene : public QGraphicsScene
{
    Q_OBJECT
public:
    //UiGraphicsScene(QObject *parent = nullptr);
    UiGraphicsScene(QImage background_img, QObject *parent = nullptr);
    ~UiGraphicsScene();

    inline void SetBackgroundImage(const QImage& img){background_image_ = img;}

    void DrawDesktopIcon();

protected:
    void drawBackground(QPainter* painter, const QRectF &rect);
    void wheelEvent(QGraphicsSceneWheelEvent* evt);

private:
    QImage background_image_;
};

#endif // UIGRAPHICSSCENE_H
